import { _decorator, Label, Node } from 'cc';
import { DataItemComponent } from '../../Core/DataItemLayout';
import { SpriteFramesComponent } from './SpriteFramesComponent';
const { ccclass, property } = _decorator;

/**
 * 248139929
 * Thu Jun 27 2024 17:17:06 GMT+0800 (中国标准时间)
 */

@ccclass('MainItem')
export class MainItem extends DataItemComponent<string> {
    
    @property(SpriteFramesComponent)
    sps:SpriteFramesComponent

    @property(Label)
    nameLabel:Label

    @property(Node)
    selectNode:Node

    /**设置数据 */
    setData(data: string) {
        this.sps.selectSpritFrame(this.idx)
        this.nameLabel.string = data
    }
    protected refToggleType(isSelect:boolean){ 
        this.selectNode.active = isSelect
    }
}
